package cn.com.anypay.manager.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import cn.com.anypay.manager.bean.WxAppConfig;
import cn.com.anypay.manager.bean.WxpayMerchantConfig;
import cn.com.anypay.manager.bean.WxpayServiceProviderConfig;

/**
 * 微信配置类
 */
@Configuration
@ConfigurationProperties(prefix = "wx")
public class WxpayConfig {
    /**
     * 小程序配置
     */
    private WxAppConfig miniapp;

    /**
     * 公众号配置
     */
    private WxAppConfig mp;

    /**
     * 商户配置
     */
    private WxpayMerchantConfig merchant;

    /**
     * 服务商配置
     */
    private WxpayServiceProviderConfig serviceProvider;

    @Bean(name = "wxPayMiniappConfig")
    public WxAppConfig miniappConfig() {
        return miniapp;
    }

    @Bean(name = "wxPayMpConfig")
    public WxAppConfig mpConfig() {
        return mp;
    }

    @Bean(name = "wxPayMerchantConfig")
    public WxpayMerchantConfig merchantConfig() {
        return merchant;
    }

    @Bean(name = "wxPayServiceProviderConfig")
    public WxpayServiceProviderConfig serviceProviderConfig() {
        return serviceProvider;
    }

    // Getters and Setters
    public WxAppConfig getMiniapp() {
        return miniapp;
    }

    public void setMiniapp(WxAppConfig miniapp) {
        this.miniapp = miniapp;
    }

    public WxAppConfig getMp() {
        return mp;
    }

    public void setMp(WxAppConfig mp) {
        this.mp = mp;
    }

    public WxpayMerchantConfig getMerchant() {
        return merchant;
    }

    public void setMerchant(WxpayMerchantConfig merchant) {
        this.merchant = merchant;
    }

    public WxpayServiceProviderConfig getServiceProvider() {
        return serviceProvider;
    }

    public void setServiceProvider(WxpayServiceProviderConfig serviceProvider) {
        this.serviceProvider = serviceProvider;
    }
}